<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <iframe src="" frameborder="0"></iframe>
  <script>
    const arr = [1,2,3,4,5,6,7,8,9,10];
    // 方法一
    // console.log(Object.prototype.toString.call(arr)==='[object Array]');
    // 不足
    const obj = {
      [Symbol.toStringTag]:'Array'
    }
    // console.log(Object.prototype.toString.call(obj)==='[object Array]');

    // 方法二
    // console.log(arr instanceof Array);
    // console.log(obj instanceof Array);
    // 不足1
    const obj2 = {}
    Object.setPrototypeOf(obj2,Array.prototype)
    // console.log(obj2 instanceof Array);
    // 不足2
    const Array1 = window.Array
    const iframe = document.querySelector('iframe')
    const Array2 = iframe.contentWindow.Array
    // console.log(Array1===Array2);
    const arr2 = new Array2()
    // console.log(arr2 instanceof Array);

    // 方法三
    console.log(Array.isArray(arr));
    console.log(Array.isArray(obj));
    console.log(Array.isArray(obj2));
    console.log(Array.isArray(arr2));
  </script>
</body>
</html>